package com.iiifi.kite.ip2region.configuration;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ResourceLoader;

import com.iiifi.kite.ip2region.core.Ip2regionSearcher;
import com.iiifi.kite.ip2region.impl.Ip2regionSearcherImpl;
import com.iiifi.kite.ip2region.properties.Ip2regionProperties;

/**
 * ip2region 自动化配置
 *
 * @author kite@iiifi.com 花朝
 */
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(Ip2regionProperties.class)
public class Ip2regionAutoConfiguration {

    @Bean
    public Ip2regionSearcher ip2regionSearcher(ResourceLoader resourceLoader, Ip2regionProperties properties) {
        return new Ip2regionSearcherImpl(resourceLoader, properties);
    }

}
